package com.bdqn.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bdqn.model.YouHuiType;
import com.bdqn.service.YouHuiTypeService;

@Controller
@RequestMapping("/youhui")
public class YouHuiTypeController {

	@Autowired
	private YouHuiTypeService youHuiTypeService;
	
	@RequestMapping("/type")
	@ResponseBody
	public List<YouHuiType> listAll(){
		
		String state = "启用";
		
		List<YouHuiType> yt = youHuiTypeService.listAll(state);
		
		for (YouHuiType youHuiType : yt) {
			System.out.println(youHuiType.getName());
		}
		return yt;
	}
}
